<h1>
  <%= @user.username.upcase + "的" %>个人信息
</h1>

<div>
  <div class="panel panel-default">
    <!-- Default panel contents -->

    <!-- Table -->
    <table class="table">
      <caption>
        <!-- Columns start at 50% wide on mobile and bump up to 33.3% wide on desktop -->
        <div class="row">
          <div class="col-xs-6 col-md-4">邮箱地址</div>
          <div class="col-xs-3 col-md-4">用户昵称</div>
          <div class="col-xs-6 col-md-4">创建时间</div>
        </div>
      </caption>

      <tbody>
        <tr class="row">
          <td class="col-xs-6 col-md-4"><%= @user.email %></td>
          <td class="col-md-3 col-md-4"><%= @user.username %></td>
          <td class="col-xs-6 col-md-4">
            Posted <%= time_ago_in_words(@user.created_at) %> ago.
          </td>
        </tr>


      </tbody>
    </table>
  </div>
</div>

<% if user_signed_in? %>
  <% if current_user.id == @user.id %>
    <form method='get' action='/users/edit'>
      <button type='submit' class='btn btn-primary' style="width: 100%; ">编辑或删除</button>
    </form>
  <% end %>
<% end %>


<h2>个人博客</h2>
<% @userarticles.each do |article| %>
  <div class="media">

    <div class="media-body">
      <h4 class="media-heading"><a href="/articles/<%= article.id %>">标题: <%= article.title %></a></h4>
      <div class="media-heading">作者: <%= article.username %></div>
      <div class="method-detail">内容：<%= article.text %></div>
    </div>
  </div>
<% end %>

<h2>个人评论</h2>


<% @usercomments.each do |comment| %>
  <% commentsacticle = Article.find(comment.article_id) %>

  <div class="media">

    <div class="media-body">
      <h4 class="media-heading"><a href="/articles/<%= comment.article_id %>">标题: <%= commentsacticle.title %></a></h4>
      <div class="media-bottom">我的评论：<%= comment.body %></div>
    </div>
  </div>
<% end %>


